<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class CdnDomain extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'cdn_domains';
    

    public function scopeShow($query){
		return $query->where('state',1);
	}

	//图片cdn
	public function scopeImg($query){
		return $query->whereIn('type',[0,1])->orderBy('type','desc');
	}

	//视频cdn
	public function scopeVideo($query){
		return $query->whereIn('type',[0,2])->orderBy('type','desc');
	}

}
